const {
  override,
  addWebpackAlias,
  fixBabelImports,
  addBabelPlugins
} = require('customize-cra')

const path = require('path')

function resolve(dir) {
  return path.join(__dirname, dir)
}

module.exports = {
  webpack: override(
    addWebpackAlias({
      '@': resolve('src')
    }),
    fixBabelImports({
      libraryName: 'antd-mobile',
      style: 'css',
    }),
    addBabelPlugins([
      "@babel/plugin-proposal-decorators", {"legacy": true}
    ]),
    addBabelPlugins([
      "@babel/plugin-proposal-class-properties", {"loose": false}
    ]),

  )
}